package com.HomeWorkhsp.chapter13.stringbuffer_;
import java.util.Scanner;
public class StringBufferExercise01 {
    public static void main(String[] args) {
        System.out.print("请输入商品名：");
        Scanner in = new Scanner(System.in);
        String str = in.next();
        System.out.print("商品价格：");
        StringBuffer strb = new StringBuffer(in.next());
        int index = strb.indexOf(".");
        for(int i = index - 3; i > 0; i -= 3){
            strb = strb.insert(i, ",");
        }
        System.out.println("==========================");
        System.out.println("商品名\t商品价格");
        System.out.println(str + "\t" + strb);
    }
}
